﻿using System;
using System.Data;
using System.Windows.Forms;
using System.IO;

namespace PictureResizerForms
{
    public partial class frm_Config : Form
    {

        private GlobalSettings _MyGlobalSettings;
        private DataTable _dtTemplates;

        public frm_Config()
        {
            InitializeComponent();

            this.init();
        }

        private void init()
        {
            _MyGlobalSettings = new GlobalSettings();
            _dtTemplates = _MyGlobalSettings.Templates().dt;
            dataGridView_Templates.DataSource = _dtTemplates;
        }

        private void schließenToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Änderungen speichern?", "Einstellungen",
            MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                _MyGlobalSettings.Save();
            }

            this.Close();
        }

        private void speichernToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _MyGlobalSettings.Save();
        }
    }
}
